"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartialCreateUserDto = exports.IntersectionUserDto = exports.OmitUserDto = exports.PickUserDto = exports.UpdateUserDto = exports.CreateUserDto = void 0;
var mapped_types_1 = require("@nestjs/mapped-types");
var CreateUserDto = /** @class */ (function () {
    function CreateUserDto() {
    }
    return CreateUserDto;
}());
exports.CreateUserDto = CreateUserDto;
// partialType 可以根据 CreateUserDto 生成一个新的类型，新类型的所有字段都是可选的
var UpdateUserDto = /** @class */ (function (_super) {
    __extends(UpdateUserDto, _super);
    function UpdateUserDto() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return UpdateUserDto;
}((0, mapped_types_1.PartialType)(CreateUserDto)));
exports.UpdateUserDto = UpdateUserDto;
// pickType 可以根据 CreateUserDto 生成一个新的类型，新类型只包含指定的字段
var PickUserDto = /** @class */ (function (_super) {
    __extends(PickUserDto, _super);
    function PickUserDto() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return PickUserDto;
}((0, mapped_types_1.PickType)(CreateUserDto, ['email'])));
exports.PickUserDto = PickUserDto;
// omitType 可以根据 CreateUserDto 生成一个新的类型，新类型不包含指定的字段
var OmitUserDto = /** @class */ (function (_super) {
    __extends(OmitUserDto, _super);
    function OmitUserDto() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return OmitUserDto;
}((0, mapped_types_1.PickType)(CreateUserDto, ['email'])));
exports.OmitUserDto = OmitUserDto;
// IntersectionType 函数将两种类型合并为一种新类型
var IntersectionUserDto = /** @class */ (function (_super) {
    __extends(IntersectionUserDto, _super);
    function IntersectionUserDto() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return IntersectionUserDto;
}((0, mapped_types_1.IntersectionType)(CreateUserDto, PickUserDto)));
exports.IntersectionUserDto = IntersectionUserDto;
// 类型映射函数组合， 生成一个PartialCreateUserDto的新类型，username必须 其它可选
var PartialCreateUserDto = /** @class */ (function (_super) {
    __extends(PartialCreateUserDto, _super);
    function PartialCreateUserDto() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return PartialCreateUserDto;
}((0, mapped_types_1.PartialType)((0, mapped_types_1.PickType)(CreateUserDto, ['username']))));
exports.PartialCreateUserDto = PartialCreateUserDto;
console.log(PartialCreateUserDto);
